<script>
// import { RouterView } from 'vue-router';
export default {
  data() {
    return {
      role: ''
    }
    
  },
  created() {
    const permission = sessionStorage.getItem("permission")
    if (permission == 1) {
      this.role = '管理员'
    } else {
      this.role = '用户'
    }
  }
}
</script>

<template>
    <el-container>
      <el-aside width="200px" class="aside">
        <span class="aside-title" >
            {{ role }}
        </span>
        <el-menu router="true">
          <el-menu-item index="/index">首页</el-menu-item>
          <el-menu-item index="/cart">购物车</el-menu-item>
          <el-menu-item index="/user">个人主页</el-menu-item>
        </el-menu>
      </el-aside>
      <el-container>
        <el-header class="header" height="6vh">
          电商平台
        </el-header>
        <el-main class="main">
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
</template>

<style scoped>
/* .header {
  background-color: #409EFF;
} */
.main {
  /* background-color: #f73302; */
  height: 94vh;
}
.aside {
  background-color: #0000004e;
}
.aside-title {
  color: #fff;
  font-size: 24px;
  line-height: 6vh;
  text-align: center;
  height: 6vh;
}
</style>